﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Data.Objects;

namespace ErrorService
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in code, svc and config file together.
    public class Service1 : IService1
    {
        public string GetData(int value)
        {
            return string.Format("You entered: {0}", value);
        }

        public CompositeType GetDataUsingDataContract(CompositeType composite)
        {
            if (composite == null)
            {
                throw new ArgumentNullException("composite");
            }
            if (composite.BoolValue)
            {
                composite.StringValue += "Suffix";
            }
            return composite;
        }

        public List<ErrorLogListele_Result> errorListele()
        {
            DBConnection db = new DBConnection();
            return db.ConnectDB.ErrorLogListele().ToList();
        }

        public void errorEkle(int id, string aciklama, int islemTuru, string olusmaYeri)
        {
            DBConnection db = new DBConnection();
            db.ConnectDB.ErrorLogEkle(id,aciklama,islemTuru,olusmaYeri);
        }


        public List<KullaniciLoglariniCek_Result> KullaniciLogCek(DateTime baslangic, DateTime bitis, int islemTuru)
        {
            DBConnection cn = new DBConnection();
            return cn.ConnectDB.KullaniciLoglariniCek(baslangic, bitis, islemTuru).ToList() ;
        }

        public List<GirisLoglariniCek_Result> GirisLogCek(DateTime baslangic, DateTime bitis, int islemTuru)
        {
            DBConnection cn = new DBConnection();
            return cn.ConnectDB.GirisLoglariniCek(baslangic, bitis, islemTuru).ToList();
        }

        public List<MasaTipiLoglariniCek_Result> MasaTipiLogCek(DateTime baslangic, DateTime bitis, int islemTuru)
        {
            DBConnection cn = new DBConnection();
            return cn.ConnectDB.MasaTipiLoglariniCek(baslangic, bitis, islemTuru).ToList();
        }

        public List<MasaLoglariniCek_Result> MasaLogCek(DateTime baslangic, DateTime bitis, int islemTuru)
        {
            DBConnection cn = new DBConnection();
            return cn.ConnectDB.MasaLoglariniCek(baslangic, bitis, islemTuru).ToList();
        }

        public List<MusteriLoglariniCek_Result> MusteriLogCek(DateTime baslangic, DateTime bitis, int islemTuru)
        {
            DBConnection cn = new DBConnection();
            return cn.ConnectDB.MusteriLoglariniCek(baslangic, bitis, islemTuru).ToList();
        }

        public List<OncelikLoglariniCek_Result> OncelikLogCek(DateTime baslangic, DateTime bitis, int islemTuru)
        {
            DBConnection cn = new DBConnection();
            return cn.ConnectDB.OncelikLoglariniCek(baslangic, bitis, islemTuru).ToList();
        }

        public List<RezervasyonLoglariniCek_Result> RezervasyonLogCek(DateTime baslangic, DateTime bitis, int islemTuru)
        {
            DBConnection cn = new DBConnection();
            return cn.ConnectDB.RezervasyonLoglariniCek(baslangic, bitis, islemTuru).ToList();
        }
    }
}
